<!--
 * @Description: * 我的资料
 * @Date: 2021-01-04 21:04:45
 * @LastEditTime: 2021-03-22 21:28:43
 * @Author: Ji YingHao
 * @FilePath: \iview\iview\components\mydata.vue
-->
<template>
   <div class="mydata" v-if="userData != null">
       <Row>
            <Col span="4" class="vip_1">用户名</Col>
            <Col span="20" class="vip_2">{{ userData.account }}</Col>
        </Row>
        <Row>
            <Col span="4" class="vip_1">所属模型</Col>
            <Col span="20" class="vip_2">{{ userData.levelName }}</Col>
        </Row>
        <Row>
            <Col span="4" class="vip_1">注册时间</Col>
            <Col span="20" class="vip_2">{{ userData.createTime }}</Col>
        </Row>
        <Row>
            <Col span="4" class="vip_1">最后登录</Col>
            <Col span="20" class="vip_2">{{ userData.spreadTime }}</Col>
        </Row>
        <Row>
            <Col span="4" class="vip_1">注册ip</Col>
            <Col span="20" class="vip_2">{{ userData.lastIp }}</Col>
        </Row>
        <Row>
            <Col span="4" class="vip_1">上次登录时间</Col>
            <Col span="20" class="vip_2">{{ userData.updateTime }}</Col>
        </Row>
        <Row>
            <Col span="4" class="vip_1"></Col>
            <Col span="20" class="vip_2">
            <Button type="primary" shape="circle" icon="ios-search" @click="openSetPass">修改邮箱</Button>
            <Button type="primary" shape="circle" icon="ios-search" @click="openSetEmail">修改密码</Button>
            </Col>
        </Row>
        <SetPass ref="setPassRef" />
        <SetEmai ref="setEmaiRef" />
   </div>
</template>
<script>
import SetPass from './pass'
import SetEmai from './emai'
   export default { 
      name: "mydata",
      components: {SetPass,SetEmai},
      data() {
         return {
             userData: null
         }
      },
      computed: {},
      mounted: function() {
          this.userData = this.$store.state.user.userData;
          console.log( '---------------------', this.$store.state.user.userData );
      },
      methods: {
          openSetPass(){
              this.$refs.setPassRef.open();
          },
          openSetEmail(){
              this.$refs.setEmaiRef.open();
          }
      }
   }
</script>
<style lang="scss">
.mydata {
  padding-top: 50px;
  padding-bottom: 90px;
  .vip_1 {
    text-align: right;
    padding-bottom: 15px;
  }
  .vip_2 {
    text-align: left;
    padding-left: 30px;
    padding-bottom: 15px;
  }
}
</style>